home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindlink.net!uniserve!usenet
- From: nowher@anyplace.com (Chris)
- Newsgroups: comp.lang.c++
- Subject: Re: Help!! I'm a stuck newbie - input problem
- Date: 30 Jan 1996 03:09:40 GMT
- Organization: UNIServe Online
- Distribution: world
- Message-ID: <4ek25k$qta@atlas.uniserve.com>
- References: <4eh3vl$g8i@atlas.uniserve.com> <4eipbe$jnd@nic.cc.ruu.nl>
- NNTP-Posting-Host: van0128.tvs.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.2
-
- In article <4eipbe$jnd@nic.cc.ruu.nl>, erikp says...
- >
- >Hi Chris,
- >
- >You can use the C-function <strncpy> or <sprintf> to limit the number
- >of characters copied into an array, or by formatting an iostream object.
- >But I'm not sure I understand your problem...
- >Erik
-
-
- I have tried the strncpy function and it limits the length of the input.
- I also tried cin.width which also nicely limited the length of the input
- string. My exact problem is that I don't wan't the cursor to over-run
- the width of the field:
-
- Part Number:( )
- Length:( )
- Width:( )
- .
- .
- .
-
- The bracket on the right should be the limit of the input. I would like
- to beep the user when/if the user reaches the right side of the field.
- I have tried the getch() function in conjunction with wherex(), but this
- failed. Perhaps I am asking the wrong question. What is the easiest way
- of dealing with an array of char?
-
- Actually, when I use char PartNum[20]; I have trouble assigning a
- value to it. I get the error --Lvalue required--.
-
- Terribly sorry if this isn't any more clear.
-
- Thanks for any help!
-
- Chris
-
-